(function() {
    Path.on('/admin/:__basename__.html', function(_current_location) {
        if (!App.get('loginer')) {
            coAjax.post(apis.admin.loginer, function(result) {
                App.set('loginer', result);
            }, function(err) {
                Path.jump('/login.html');
            });
        }
    });

    App.set('$Event.top.refreshAccessToken', function() {
        coAjax.put(apis.admin.refreshAccessToken, function(result) {
            App.set('loginer', result);
        }, function(errCode, errMsg, err) {
            alert('warn', errMsg);
        })
    })
}());
